<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <button>发送短信</button>
  <script>
    // const obj = {
    //   uname: '张三'
    // }
    // function fn(a, b) {
    //   console.log(this); //obj
    //   console.log(a + b); 
    // }
    // const fun = fn.bind(obj, 23, 45)
    // fun()
    // const btn = document.querySelector('button')
    // btn.addEventListener('click', function () {
    //   this.disabled = true
    //   setInterval(function () {
    //     this.disabled = false
    //   }.bind(btn), 2000)
    // })
    const btn = document.querySelector('button')
    btn.addEventListener('click', function () {
      this.disabled = true
      setInterval(() => {
        this.disabled = false
      }, 2000)
    })
  </script>
</body>

</html>